package com.act.moudles.baseAct.service.impl;

import com.act.moudles.baseAct.dao.OnlineDeployDao;
import com.act.moudles.baseAct.entity.OnlineDeploy;
import com.act.utils.EmptyPage;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.act.moudles.baseAct.dao.TaskAnoDao;
import com.act.moudles.baseAct.entity.TaskAno;
import com.act.moudles.baseAct.service.TaskAnoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 任务注解(TaskAno)表服务实现类
 *
 * @author makejava
 * @since 2023-05-14 02:05:18
 */
@Service("taskAnoService")
public class TaskAnoServiceImpl extends ServiceImpl<TaskAnoDao, TaskAno> implements TaskAnoService {


    @Resource
    private OnlineDeployDao onlineDeployDao;

    @Override
    public IPage<TaskAno> pageTaskAno(Page<TaskAno> page, TaskAno taskAno) {
        if(taskAno.getDeployId() == null){
            return new EmptyPage();
        }
        //查询流程
        OnlineDeploy onlineDeploy = onlineDeployDao.selectById(taskAno.getDeployId());
        taskAno.setTenantId(onlineDeploy.getTenantId());
        taskAno.setProcdefKey(onlineDeploy.getProcdefKey());
        return page(page,taskAno.query());
    }
}

